// todo
import treeTools from '@/common/treeTools'

const noop = function (){

}
export default {
  props: {
    'toDisabled': {
      type: Function,
      default: noop
    },
  },
  methods: {
    checkDisabled(tree) {
      if (typeof this.toDisabled === 'function') {
        treeTools.iterator(tree, e => {
          if (this.toDisabled(e, tree)) {
            e.disabled = true
          }
        })
      }
    }
  }
}
